<template>
<span class="op_dir_Product-wrapper">
  <button v-if="btns.addToWh" title="添加到仓库"
          class="ui primary button tiny"
          @click.stop.prevent="addToWh()">
         {{btns.addToWh}}
        </button>
</span>
</template>
<script type="text/ecmascript-6">
import tool from 'src/util/tool';
import util from '_util/index';
import logic from '_logic';
import in_array from 'in_array';

import btn_group from 'components/common/btn_group';


export default {
    data() {
        return {}
    },
    components: {},
    methods: {
        addToWh() {
            //warehouseEdit
            let _this = this
            logic.list.checkIds(this, (ids) => {
				let data = {"selected_ids": ids}
                if (ids && ids.length > 0) {
                    this.$store.state.global.eventVue.$emit('showPopCom', {
                        _this: this,
                        id: _this.$route.query.product_id,
						ids:ids,
                        data:data,
                        name: 'warehouseEdit'
                    });

                } else {
                    util.showMsg(this, 'error', '请选择');
                }
            });
        },
    },
    computed: {
        ctl() {
            return this.$route.query.ctl;
        },
        is_admin() {
            return util.is_admin(this);
        },
    },
    props: ['btns'],
    created() {},
};
</script>
<style rel="stylesheet/less" lang="less">@dir: "header/";</style>
